package winTime.process;

import java.util.Collections;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import winTime.vo.TickKLine;
import winTime.Start;
/**
 * @author 顯示Tick資料內容
 *
 */
public class DisplayTick extends Thread{
	private static final Logger log=LoggerFactory.getLogger(DisplayTick.class);
	private static final String p="|";
	@Override
	public void run(){
		log.trace("DisplayTick start");
		int wait = 5000;
		while(true){
			try {
				Thread.sleep(wait);
				printTick();
			} catch (Exception e) {
				log.error("error:{}",e);
			}
		}
	}
	private void printTick(){
		for(TickKLine tk : Start.td){
//			log.trace("print:{}",tk.toString());
			log.trace("|{}|{}|{}|{}|{}|{}|{}|{}|{}|",Start.dateTag,tk.getCtime(),tk.getoPrice(),tk.gethPrice(),
					tk.getlPrice(),tk.getcPrice(),tk.getsQty(),tk.getCnt(),tk.getQtyPrice());
		}
//		Collections.sort(Start.td,comparator);
	}
}
